// 异或前缀和方案

#include <bits/stdc++.h>
using namespace std;

int dif[500005];
int main() {
  int n, m;
  cin >> n >> m;
  string s, t;
  cin >> s >> t;
  s = " " + s;
  t = " " + t;
  for (int i = 1; i <= m; i++) {
    int L, R;
    cin >> L >> R;
    dif[L] ^= 1;
    dif[R + 1] ^= 1;
  }
  for (int i = 1; i <= n; i++) {
    dif[i] ^= dif[i - 1]; // 求异或前缀和，得到原数组
  }
  for (int i = 1; i <= n; i++) {
    cout << (dif[i] == 0 ? s[i] : t[i]);
  }

  return 0;
}
